<form name="child_list" action="index.php" enctype="multipart/form-data" method="post">
<input name="admin" type="hidden" value="1">
<input name="module" type="hidden" value="contacts">
<input name="mod" type="hidden" value="group">
<input name="act" type="hidden" value="">
<input name="parent" type="hidden" value="">
<input name="referer" type="hidden" value="{ext->get_referer}">
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="12"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
	</tr>
	<tr>
		<td height="1" bgcolor="#25404E"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
	</tr>
</table>
{ext->aasort array=$groups_list args="+name" assign="groups_list2"}
{assign var="groups_list" value=$groups_list2}
{ext->countArray array=$groups_list assign="groups_count"}
{if $groups_count > 0}
	<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
		<tr>		
			<td  height="20" style="font-size:9px; color:#4C4C4C; text-align:center; border-right:1px solid #D6DBDE" width="70">{t t='Žymėjimas'}</td>	
			<td style="font-size:9px; color:#4C4C4C; text-align:left; padding:0px 0px 0px 10px">{t t='Pavadinimas'}</td>			
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	{ext->class_function class="contacts" func="get_all_modules" user=$smarty.session.login_user assign="modules_list"}
	{foreach from=$groups_list item="el"}
		{assign var="el_id" value=$el.id}
		{if ($el.parent == 0) && (($modules_list.product_groups) && ($modules_list.product_groups.$el_id==1))}
			{if $_var.contacts.view_group == 'only_selected' && $smarty.get.tpl_group_filter}
				{if $smarty.get.tpl_group_filter==$el.id}
					<!-- * -->
					<table width="100%" cellpadding="0" cellspacing="0">
						<tr>
							<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
						</tr>
					</table>
					<table width="100%" cellpadding="0" cellspacing="0" bgcolor="{if $el.parent}#ffffff{else}#F4F6F7{/if}">
						<tr>			
							<td height="22" width="70" align="center" style="border-right:1px solid #D6DBDE"><input name="ids[{$el.id}]" value="{$el.id}" type="checkbox"></td>			
							<td style="padding:0px 0px 0px 10px; border-right:1px solid #D6DBDE"><a href="index.php?admin=1&tpl_group_filter={$el.id}&tpl_contacts_module=groups" target="_self" {if $smarty.get.tpl_group_filter==$el.id} style="font-weight:bold" {/if}>{$el.name}</a></td>
							<td width="50" style="border-right:1px solid #D6DBDE" align="center"><a onClick="openCenteredOnOpenerWindow('index.php?admin=1&group_id={$el.id}&popup=65','new_subgroup',400,300,1,0); return false" href="#"><img src="_tvs_system_core_/design/img/icon_new_doc.gif"></a></td>
							<td align="center" width="50"><a onClick="openCenteredOnOpenerWindow('index.php?admin=1&group_id={$el.id}&popup=66','group_modif',400,300,1,0); return false" href="#"><img src="_tvs_system_core_/design/img/admin/_icon_page_properties.gif"></a></td>
						</tr>
					</table>
					<table width="100%" cellpadding="0" cellspacing="0">
						<tr>
							<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
						</tr>
					</table>
					<!-- /* -->
					{if $smarty.get.tpl_group_filter==$el.id}
						{foreach from=$groups_list item="el2"}
							{assign var="el_id" value=$el2.id}
							{if ($el2.parent == $el.id) && ($modules_list.product_groups.$el_id==1)}
							<!-- * -->
							<table width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
								</tr>
							</table>
							<table width="100%" cellpadding="0" cellspacing="0" bgcolor="{if $el2.parent}#ffffff{else}#F4F6F7{/if}">
								<tr>			
									<td height="22" width="70" align="center" style="border-right:1px solid #D6DBDE"><input name="ids[{$el2.id}]" value="{$el2.id}" type="checkbox"></td>			
									<td style="padding:0px 0px 0px 50px;  border-right:0px solid #D6DBDE"><a href="index.php?admin=1&tpl_contacts_module=goods&group_id={$el2.id}&tpl_group_filter={$el.id}">{$el2.name}</a></td>
									<td align="center" width="50" style="border-right:1px solid #D6DBDE; border-left:1px solid #D6DBDE;"><a onClick="openCenteredOnOpenerWindow('index.php?admin=1&group_id={$el2.id}&popup=66','group_modif',400,300,1,0); return false" href="#"><img src="_tvs_system_core_/design/img/icon_new_doc.gif"></a></td>
									<td align="center" width="50"><a onClick="openCenteredOnOpenerWindow('index.php?admin=1&group_id={$el2.id}&popup=66','group_modif',400,300,1,0); return false" href="#"><img src="_tvs_system_core_/design/img/admin/_icon_page_properties.gif"></a></td>
								</tr>
							</table>
							<table width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
								</tr>
							</table>
							<!-- /* -->
							{/if}
						{/foreach}
					{/if}
				{/if}
			{else}
				<!-- * -->
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					</tr>
				</table>
				<table width="100%" cellpadding="0" cellspacing="0" bgcolor="{if $el.parent}#ffffff{else}#F4F6F7{/if}">
					<tr>			
						<td height="22" width="70" align="center" style="border-right:1px solid #D6DBDE"><input name="ids[{$el.id}]" value="{$el.id}" type="checkbox"></td>			
						<td style="padding:0px 0px 0px 10px; border-right:1px solid #D6DBDE"><a href="index.php?admin=1&tpl_group_filter={$el.id}&tpl_contacts_module=groups" target="_self" {if $smarty.get.tpl_group_filter==$el.id} style="font-weight:bold" {/if}>{$el.name}</a></td>
						<td width="50" style="border-right:1px solid #D6DBDE" align="center"><a onClick="openCenteredOnOpenerWindow('index.php?admin=1&group_id={$el.id}&popup=65','new_subgroup',400,300,1,0); return false" href="#"><img src="_tvs_system_core_/design/img/icon_new_doc.gif"></a></td>
						<td align="center" width="50"><a onClick="openCenteredOnOpenerWindow('index.php?admin=1&group_id={$el.id}&popup=66','group_modif',400,300,1,0); return false" href="#"><img src="_tvs_system_core_/design/img/admin/_icon_page_properties.gif"></a></td>
					</tr>
				</table>
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					</tr>
				</table>
				<!-- /* -->
				{if $smarty.get.tpl_group_filter==$el.id}
					{foreach from=$groups_list item="el2"}
						{assign var="el_id" value=$el2.id}
						{if ($el2.parent == $el.id) && ($modules_list.product_groups.$el_id==1)}
						<!-- * -->
						<table width="100%" cellpadding="0" cellspacing="0">
							<tr>
								<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
							</tr>
						</table>
						<table width="100%" cellpadding="0" cellspacing="0" bgcolor="{if $el2.parent}#ffffff{else}#F4F6F7{/if}">
							<tr>			
								<td height="22" width="70" align="center" style="border-right:1px solid #D6DBDE"><input name="ids[{$el2.id}]" value="{$el2.id}" type="checkbox"></td>			
								<td style="padding:0px 0px 0px 50px;  border-right:0px solid #D6DBDE"><a href="index.php?admin=1&tpl_contacts_module=goods&group_id={$el2.id}&tpl_group_filter={$el.id}">{$el2.name}</a></td>
								{ext->class_function class="contacts" func="get_manufacture_id" group_id=$el2.id assign="product_id"}								<td align="center" width="50" style="border-right:1px solid #D6DBDE; border-left:1px solid #D6DBDE;"><a href="index.php?admin=1&tpl_contacts_module=edit&product_id={$product_id}&group_id={$el2.id}&tpl_group_filter={$el.id}"><img src="_tvs_system_core_/design/img/icon_new_doc.gif"></a></td>
								<td align="center" width="50"><a onClick="openCenteredOnOpenerWindow('index.php?admin=1&group_id={$el2.id}&popup=66','group_modif',400,300,1,0); return false" href="#"><img src="_tvs_system_core_/design/img/admin/_icon_page_properties.gif"></a></td>
							</tr>
						</table>
						<table width="100%" cellpadding="0" cellspacing="0">
							<tr>
								<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
							</tr>
						</table>
						<!-- /* -->
						{/if}
					{/foreach}
				{/if}
			{/if}	
		{/if}
	{/foreach}
{else}
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="50" bgcolor="#FFFFFF" align="center" style="padding:15px">{t t='Nėra nei vienos grupės'}</td>		
	</tr>
</table>
{/if}

<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="1" bgcolor="#25404E"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
	</tr>
	<tr>
		<td height="12"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
	</tr>	
</table>
</form>